<template>
  <div class="row justify-content-center">
    <div class="col-8">
      <form name="editForm" role="form" novalidate v-on:submit.prevent="save()">
        <h2 id="roomAdminApp.roomGoods.home.createOrEditLabel" data-cy="RoomGoodsCreateUpdateHeading">Create or edit a RoomGoods</h2>
        <div>
          <div class="form-group" v-if="roomGoods.id">
            <label for="id">ID</label>
            <input type="text" class="form-control" id="id" name="id" v-model="roomGoods.id" readonly />
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-bkRoomType">Bk Room Type</label>
            <input
              type="number"
              class="form-control"
              name="bkRoomType"
              id="room-goods-bkRoomType"
              data-cy="bkRoomType"
              :class="{ valid: !$v.roomGoods.bkRoomType.$invalid, invalid: $v.roomGoods.bkRoomType.$invalid }"
              v-model.number="$v.roomGoods.bkRoomType.$model"
            />
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-bkNo">Bk No</label>
            <input
              type="text"
              class="form-control"
              name="bkNo"
              id="room-goods-bkNo"
              data-cy="bkNo"
              :class="{ valid: !$v.roomGoods.bkNo.$invalid, invalid: $v.roomGoods.bkNo.$invalid }"
              v-model="$v.roomGoods.bkNo.$model"
            />
            <div v-if="$v.roomGoods.bkNo.$anyDirty && $v.roomGoods.bkNo.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.bkNo.maxLength">
                This field cannot be longer than 32 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-title">Title</label>
            <input
              type="text"
              class="form-control"
              name="title"
              id="room-goods-title"
              data-cy="title"
              :class="{ valid: !$v.roomGoods.title.$invalid, invalid: $v.roomGoods.title.$invalid }"
              v-model="$v.roomGoods.title.$model"
            />
            <div v-if="$v.roomGoods.title.$anyDirty && $v.roomGoods.title.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.title.maxLength">
                This field cannot be longer than 1024 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-oldprice">Oldprice</label>
            <input
              type="text"
              class="form-control"
              name="oldprice"
              id="room-goods-oldprice"
              data-cy="oldprice"
              :class="{ valid: !$v.roomGoods.oldprice.$invalid, invalid: $v.roomGoods.oldprice.$invalid }"
              v-model="$v.roomGoods.oldprice.$model"
            />
            <div v-if="$v.roomGoods.oldprice.$anyDirty && $v.roomGoods.oldprice.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.oldprice.maxLength">
                This field cannot be longer than 32 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-buildingSize">Building Size</label>
            <input
              type="text"
              class="form-control"
              name="buildingSize"
              id="room-goods-buildingSize"
              data-cy="buildingSize"
              :class="{ valid: !$v.roomGoods.buildingSize.$invalid, invalid: $v.roomGoods.buildingSize.$invalid }"
              v-model="$v.roomGoods.buildingSize.$model"
            />
            <div v-if="$v.roomGoods.buildingSize.$anyDirty && $v.roomGoods.buildingSize.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.buildingSize.maxLength">
                This field cannot be longer than 32 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-roomType">Room Type</label>
            <input
              type="text"
              class="form-control"
              name="roomType"
              id="room-goods-roomType"
              data-cy="roomType"
              :class="{ valid: !$v.roomGoods.roomType.$invalid, invalid: $v.roomGoods.roomType.$invalid }"
              v-model="$v.roomGoods.roomType.$model"
            />
            <div v-if="$v.roomGoods.roomType.$anyDirty && $v.roomGoods.roomType.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.roomType.maxLength">
                This field cannot be longer than 32 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-roomFloor">Room Floor</label>
            <input
              type="text"
              class="form-control"
              name="roomFloor"
              id="room-goods-roomFloor"
              data-cy="roomFloor"
              :class="{ valid: !$v.roomGoods.roomFloor.$invalid, invalid: $v.roomGoods.roomFloor.$invalid }"
              v-model="$v.roomGoods.roomFloor.$model"
            />
            <div v-if="$v.roomGoods.roomFloor.$anyDirty && $v.roomGoods.roomFloor.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.roomFloor.maxLength">
                This field cannot be longer than 32 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-buildingType">Building Type</label>
            <input
              type="text"
              class="form-control"
              name="buildingType"
              id="room-goods-buildingType"
              data-cy="buildingType"
              :class="{ valid: !$v.roomGoods.buildingType.$invalid, invalid: $v.roomGoods.buildingType.$invalid }"
              v-model="$v.roomGoods.buildingType.$model"
            />
            <div v-if="$v.roomGoods.buildingType.$anyDirty && $v.roomGoods.buildingType.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.buildingType.maxLength">
                This field cannot be longer than 32 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-ladderhousehold">Ladderhousehold</label>
            <input
              type="text"
              class="form-control"
              name="ladderhousehold"
              id="room-goods-ladderhousehold"
              data-cy="ladderhousehold"
              :class="{ valid: !$v.roomGoods.ladderhousehold.$invalid, invalid: $v.roomGoods.ladderhousehold.$invalid }"
              v-model="$v.roomGoods.ladderhousehold.$model"
            />
            <div v-if="$v.roomGoods.ladderhousehold.$anyDirty && $v.roomGoods.ladderhousehold.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.ladderhousehold.maxLength">
                This field cannot be longer than 16 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-floorStructure">Floor Structure</label>
            <input
              type="text"
              class="form-control"
              name="floorStructure"
              id="room-goods-floorStructure"
              data-cy="floorStructure"
              :class="{ valid: !$v.roomGoods.floorStructure.$invalid, invalid: $v.roomGoods.floorStructure.$invalid }"
              v-model="$v.roomGoods.floorStructure.$model"
            />
            <div v-if="$v.roomGoods.floorStructure.$anyDirty && $v.roomGoods.floorStructure.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.floorStructure.maxLength">
                This field cannot be longer than 16 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-roomTowards">Room Towards</label>
            <input
              type="text"
              class="form-control"
              name="roomTowards"
              id="room-goods-roomTowards"
              data-cy="roomTowards"
              :class="{ valid: !$v.roomGoods.roomTowards.$invalid, invalid: $v.roomGoods.roomTowards.$invalid }"
              v-model="$v.roomGoods.roomTowards.$model"
            />
            <div v-if="$v.roomGoods.roomTowards.$anyDirty && $v.roomGoods.roomTowards.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.roomTowards.maxLength">
                This field cannot be longer than 8 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-roomFitment">Room Fitment</label>
            <input
              type="text"
              class="form-control"
              name="roomFitment"
              id="room-goods-roomFitment"
              data-cy="roomFitment"
              :class="{ valid: !$v.roomGoods.roomFitment.$invalid, invalid: $v.roomGoods.roomFitment.$invalid }"
              v-model="$v.roomGoods.roomFitment.$model"
            />
            <div v-if="$v.roomGoods.roomFitment.$anyDirty && $v.roomGoods.roomFitment.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.roomFitment.maxLength">
                This field cannot be longer than 8 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-listingTime">Listing Time</label>
            <b-input-group class="mb-3">
              <b-input-group-prepend>
                <b-form-datepicker
                  aria-controls="room-goods-listingTime"
                  v-model="$v.roomGoods.listingTime.$model"
                  name="listingTime"
                  class="form-control"
                  :locale="currentLanguage"
                  button-only
                  today-button
                  reset-button
                  close-button
                >
                </b-form-datepicker>
              </b-input-group-prepend>
              <b-form-input
                id="room-goods-listingTime"
                data-cy="listingTime"
                type="text"
                class="form-control"
                name="listingTime"
                :class="{ valid: !$v.roomGoods.listingTime.$invalid, invalid: $v.roomGoods.listingTime.$invalid }"
                v-model="$v.roomGoods.listingTime.$model"
              />
            </b-input-group>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-lastTradeTime">Last Trade Time</label>
            <b-input-group class="mb-3">
              <b-input-group-prepend>
                <b-form-datepicker
                  aria-controls="room-goods-lastTradeTime"
                  v-model="$v.roomGoods.lastTradeTime.$model"
                  name="lastTradeTime"
                  class="form-control"
                  :locale="currentLanguage"
                  button-only
                  today-button
                  reset-button
                  close-button
                >
                </b-form-datepicker>
              </b-input-group-prepend>
              <b-form-input
                id="room-goods-lastTradeTime"
                data-cy="lastTradeTime"
                type="text"
                class="form-control"
                name="lastTradeTime"
                :class="{ valid: !$v.roomGoods.lastTradeTime.$invalid, invalid: $v.roomGoods.lastTradeTime.$invalid }"
                v-model="$v.roomGoods.lastTradeTime.$model"
              />
            </b-input-group>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-roomAgeLimit">Room Age Limit</label>
            <input
              type="text"
              class="form-control"
              name="roomAgeLimit"
              id="room-goods-roomAgeLimit"
              data-cy="roomAgeLimit"
              :class="{ valid: !$v.roomGoods.roomAgeLimit.$invalid, invalid: $v.roomGoods.roomAgeLimit.$invalid }"
              v-model="$v.roomGoods.roomAgeLimit.$model"
            />
            <div v-if="$v.roomGoods.roomAgeLimit.$anyDirty && $v.roomGoods.roomAgeLimit.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.roomAgeLimit.maxLength">
                This field cannot be longer than 16 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-roomMortgage">Room Mortgage</label>
            <input
              type="text"
              class="form-control"
              name="roomMortgage"
              id="room-goods-roomMortgage"
              data-cy="roomMortgage"
              :class="{ valid: !$v.roomGoods.roomMortgage.$invalid, invalid: $v.roomGoods.roomMortgage.$invalid }"
              v-model="$v.roomGoods.roomMortgage.$model"
            />
            <div v-if="$v.roomGoods.roomMortgage.$anyDirty && $v.roomGoods.roomMortgage.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.roomMortgage.maxLength">
                This field cannot be longer than 16 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-roomTransactionOwnership">Room Transaction Ownership</label>
            <input
              type="text"
              class="form-control"
              name="roomTransactionOwnership"
              id="room-goods-roomTransactionOwnership"
              data-cy="roomTransactionOwnership"
              :class="{ valid: !$v.roomGoods.roomTransactionOwnership.$invalid, invalid: $v.roomGoods.roomTransactionOwnership.$invalid }"
              v-model="$v.roomGoods.roomTransactionOwnership.$model"
            />
            <div v-if="$v.roomGoods.roomTransactionOwnership.$anyDirty && $v.roomGoods.roomTransactionOwnership.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.roomTransactionOwnership.maxLength">
                This field cannot be longer than 16 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-roomUser">Room User</label>
            <input
              type="text"
              class="form-control"
              name="roomUser"
              id="room-goods-roomUser"
              data-cy="roomUser"
              :class="{ valid: !$v.roomGoods.roomUser.$invalid, invalid: $v.roomGoods.roomUser.$invalid }"
              v-model="$v.roomGoods.roomUser.$model"
            />
            <div v-if="$v.roomGoods.roomUser.$anyDirty && $v.roomGoods.roomUser.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.roomUser.maxLength">
                This field cannot be longer than 8 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-roomPropertyRights">Room Property Rights</label>
            <input
              type="text"
              class="form-control"
              name="roomPropertyRights"
              id="room-goods-roomPropertyRights"
              data-cy="roomPropertyRights"
              :class="{ valid: !$v.roomGoods.roomPropertyRights.$invalid, invalid: $v.roomGoods.roomPropertyRights.$invalid }"
              v-model="$v.roomGoods.roomPropertyRights.$model"
            />
            <div v-if="$v.roomGoods.roomPropertyRights.$anyDirty && $v.roomGoods.roomPropertyRights.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.roomPropertyRights.maxLength">
                This field cannot be longer than 16 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-roomSpareParts">Room Spare Parts</label>
            <input
              type="text"
              class="form-control"
              name="roomSpareParts"
              id="room-goods-roomSpareParts"
              data-cy="roomSpareParts"
              :class="{ valid: !$v.roomGoods.roomSpareParts.$invalid, invalid: $v.roomGoods.roomSpareParts.$invalid }"
              v-model="$v.roomGoods.roomSpareParts.$model"
            />
            <div v-if="$v.roomGoods.roomSpareParts.$anyDirty && $v.roomGoods.roomSpareParts.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.roomSpareParts.maxLength">
                This field cannot be longer than 16 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-focusNo">Focus No</label>
            <input
              type="text"
              class="form-control"
              name="focusNo"
              id="room-goods-focusNo"
              data-cy="focusNo"
              :class="{ valid: !$v.roomGoods.focusNo.$invalid, invalid: $v.roomGoods.focusNo.$invalid }"
              v-model="$v.roomGoods.focusNo.$model"
            />
            <div v-if="$v.roomGoods.focusNo.$anyDirty && $v.roomGoods.focusNo.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.focusNo.maxLength">
                This field cannot be longer than 8 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-characteristic">Characteristic</label>
            <input
              type="text"
              class="form-control"
              name="characteristic"
              id="room-goods-characteristic"
              data-cy="characteristic"
              :class="{ valid: !$v.roomGoods.characteristic.$invalid, invalid: $v.roomGoods.characteristic.$invalid }"
              v-model="$v.roomGoods.characteristic.$model"
            />
            <div v-if="$v.roomGoods.characteristic.$anyDirty && $v.roomGoods.characteristic.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.characteristic.maxLength">
                This field cannot be longer than 128 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-roomSellPoint">Room Sell Point</label>
            <input
              type="text"
              class="form-control"
              name="roomSellPoint"
              id="room-goods-roomSellPoint"
              data-cy="roomSellPoint"
              :class="{ valid: !$v.roomGoods.roomSellPoint.$invalid, invalid: $v.roomGoods.roomSellPoint.$invalid }"
              v-model="$v.roomGoods.roomSellPoint.$model"
            />
            <div v-if="$v.roomGoods.roomSellPoint.$anyDirty && $v.roomGoods.roomSellPoint.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.roomSellPoint.maxLength">
                This field cannot be longer than 128 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-communityIntroduction">Community Introduction</label>
            <input
              type="text"
              class="form-control"
              name="communityIntroduction"
              id="room-goods-communityIntroduction"
              data-cy="communityIntroduction"
              :class="{ valid: !$v.roomGoods.communityIntroduction.$invalid, invalid: $v.roomGoods.communityIntroduction.$invalid }"
              v-model="$v.roomGoods.communityIntroduction.$model"
            />
            <div v-if="$v.roomGoods.communityIntroduction.$anyDirty && $v.roomGoods.communityIntroduction.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.communityIntroduction.maxLength">
                This field cannot be longer than 128 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-roomIntroduction">Room Introduction</label>
            <input
              type="text"
              class="form-control"
              name="roomIntroduction"
              id="room-goods-roomIntroduction"
              data-cy="roomIntroduction"
              :class="{ valid: !$v.roomGoods.roomIntroduction.$invalid, invalid: $v.roomGoods.roomIntroduction.$invalid }"
              v-model="$v.roomGoods.roomIntroduction.$model"
            />
            <div v-if="$v.roomGoods.roomIntroduction.$anyDirty && $v.roomGoods.roomIntroduction.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.roomIntroduction.maxLength">
                This field cannot be longer than 128 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-surroundingFacilities">Surrounding Facilities</label>
            <input
              type="text"
              class="form-control"
              name="surroundingFacilities"
              id="room-goods-surroundingFacilities"
              data-cy="surroundingFacilities"
              :class="{ valid: !$v.roomGoods.surroundingFacilities.$invalid, invalid: $v.roomGoods.surroundingFacilities.$invalid }"
              v-model="$v.roomGoods.surroundingFacilities.$model"
            />
            <div v-if="$v.roomGoods.surroundingFacilities.$anyDirty && $v.roomGoods.surroundingFacilities.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.surroundingFacilities.maxLength">
                This field cannot be longer than 128 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-transportation">Transportation</label>
            <input
              type="text"
              class="form-control"
              name="transportation"
              id="room-goods-transportation"
              data-cy="transportation"
              :class="{ valid: !$v.roomGoods.transportation.$invalid, invalid: $v.roomGoods.transportation.$invalid }"
              v-model="$v.roomGoods.transportation.$model"
            />
            <div v-if="$v.roomGoods.transportation.$anyDirty && $v.roomGoods.transportation.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomGoods.transportation.maxLength">
                This field cannot be longer than 128 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-roomBroker">Room Broker</label>
            <input
              type="number"
              class="form-control"
              name="roomBroker"
              id="room-goods-roomBroker"
              data-cy="roomBroker"
              :class="{ valid: !$v.roomGoods.roomBroker.$invalid, invalid: $v.roomGoods.roomBroker.$invalid }"
              v-model.number="$v.roomGoods.roomBroker.$model"
            />
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-goods-selling">Selling</label>
            <input
              type="checkbox"
              class="form-check"
              name="selling"
              id="room-goods-selling"
              data-cy="selling"
              :class="{ valid: !$v.roomGoods.selling.$invalid, invalid: $v.roomGoods.selling.$invalid }"
              v-model="$v.roomGoods.selling.$model"
            />
          </div>
        </div>
        <div>
          <button type="button" id="cancel-save" data-cy="entityCreateCancelButton" class="btn btn-secondary" v-on:click="previousState()">
            <font-awesome-icon icon="ban"></font-awesome-icon>&nbsp;<span>Cancel</span>
          </button>
          <button
            type="submit"
            id="save-entity"
            data-cy="entityCreateSaveButton"
            :disabled="$v.roomGoods.$invalid || isSaving"
            class="btn btn-primary"
          >
            <font-awesome-icon icon="save"></font-awesome-icon>&nbsp;<span>Save</span>
          </button>
        </div>
      </form>
    </div>
  </div>
</template>
<script lang="ts" src="./room-goods-update.component.ts"></script>
